import java.util.LinkedList;
import java.util.List;


public class Knoten {
	
	int id;
	int capacity;
	java.util.List<Knoten> nachfolger;
	java.util.List<Knoten> vorganger;
	
	public Knoten(int id, int cap){
		this.id = id;
		this.capacity = cap;
		nachfolger = new LinkedList<Knoten>();
		vorganger = new LinkedList<Knoten>();
	}

	public void nfadd(Knoten nf){
		if (nf==null)throw new IllegalArgumentException("nachfolger null");
		this.nachfolger.add(nf);
	}
	
	public void vgadd(Knoten vg){
		if (vg==null)throw new IllegalArgumentException("vorganger null");
		this.vorganger.add(vg);
	}
	
	public List<Knoten> nfget(){
		return this.nachfolger;
	}

	@Override
	public int hashCode() {
		return capacity + id;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Knoten other = (Knoten) obj;
		if (capacity != other.capacity)
			return false;
		if (id != other.id)
			return false;
		return true;
	}
	
	
	
}
